package com.dora.rabbitmq.listener;

import com.dora.rabbitmq.po.Mail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class QueueListener2 {

    @RabbitListener(queues = "myqueue")
    public void displayMail(Mail mail) throws Exception {
        log.info("队列监听器2号,收到消息:" + mail.toString());
    }
}
